package yu.code.yurpc.serializer;

import yu.code.yurpc.spi.MySpiLoader;
import yu.code.yurpc.spi.SpiLoader;

import java.util.HashMap;
import java.util.Map;

/**
 * 序列化器工厂
 */
public class SerializerFactory {
    static {
        MySpiLoader.load(Serializer.class);
    }
    // 默认序列化器
    private static final Serializer DEFAULT_SERIALIZER = new JdkSerializer();

    /**
     * 获取实例
     *
     * @param key
     * @return
     */
    public static Serializer getInstance(String key) {
        return MySpiLoader.getInstance(key,Serializer.class);
    }
}
